#region (c) 2009 Abdullin.com and Contributors

// Copyright (c) 2009 Abdullin.com and Contributors
// Site: http://abdullin.com/ncouch
// This code is released under the terms of the new BSD licence

#endregion

using System;
using System.Collections.Generic;
using System.IO;
using Lokad;

namespace NCouch.Rest
{
	public sealed class RestRequest : IRestRequest
	{
		readonly Uri _url;
		readonly string _contentType;
		readonly string _method;
		readonly Maybe<Action<Stream>> _content;
		readonly IEnumerable<RestHeader> _headers;

		public RestRequest(
			Uri url, 
			string contentType, 
			string method, 
			Maybe<Action<Stream>> content,
			IEnumerable<RestHeader> headers)
		{
			_url = url;
			_contentType = contentType;
			_method = method;
			_content = content;
			_headers = headers;
		}

		public IEnumerable<RestHeader> Headers
		{
			get { return _headers; }
		}

		Uri IRestRequest.RequestUri
		{
			get { return _url; }
		}

		string IRestRequest.ContentType
		{
			get { return _contentType; }
		}

		string IRestRequest.Method
		{
			get { return _method; }
		}

		Maybe<Action<Stream>> IRestRequest.Content
		{
			get { return _content; }
		}
	}
}